﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using NTiering.Models;

namespace NTiering.Validators
{
    class DefaultValidator<T> : IValidator<T>
        where T :IDataModel
    {
        Func<T, IService, string> _validator;

        public DefaultValidator(Func<T,IService, string> validator)
        {
            _validator = validator;
        }

        public string Validate(T model,IService service)
        {
            return _validator(model,service);
        }
    }
}
